﻿@model WebSite.Web.Models.CompanyVM

@{
    ViewBag.Title = "公司信息维护";
    Layout = "~/Views/Shared/_ViewFormPage.cshtml";
}

@section head{
    <script charset="utf-8" src="/Scripts/kindeditor-4.1.3/kindeditor-min.js"></script>
    <script charset="utf-8" src="/Scripts/kindeditor-4.1.3/lang/zh_CN.js"></script>

    <script type="text/javascript">
        var editor;
        KindEditor.ready(function (K) {
            editor = K.create('textarea[name="CompanyDesc"]', {
                resizeType: 1,
                allowPreviewEmoticons: false,
                allowImageUpload: true,
                allowFileManager: false,
                syncType: 'form',
                width: '800px',
                height: '240px',
                uploadJson: '@Url.Action("Upload", "File")'
            });
        });

        $(function () {
            $("#btnSave").click(function () {
                if ($("form").valid()) {
                    editor.sync("CompanyDesc");
                    $('form').ajaxSubmit({
                        success: function (callback) {
                            if (callback) {
                                $.ligerDialog.success('保存成功', function (yes) {
                                    self.location.href = "/Company/Index";
                                });
                            }
                            else {
                                $.ligerDialog.error('保存失败');
                            }
                        },
                        error: function (ex) {
                            $.ligerDialog.error('保存失败');
                        }

                    });
                }
            });
        });

    </script>
    @if (false)
    {
        <script src="../../Scripts/jquery-1.8.2.js"></script>
    }
    <style type="text/css">
    </style>
}
<div id="header" class="header">
    <h4>公司信息 -- 维护</h4>
</div>
@using (Html.BeginForm("Index", "Company", FormMethod.Post))
{
    @Html.HiddenFor(model => model.CompanyId)
    <div id="detail_forms">
        <div class="formsItems clearfix">
            <div class="formItem labelItem">
                标题
            </div>
            <div class="formItem textItem">
                @Html.TextBoxFor(model => model.CompanyName, new { @class = "texts" })
            </div>
            <div class="formItem msgItem">
            </div>
        </div>
        <div class="formsItems clearfix">
            <div class="formItem labelItem">
                地址
            </div>
            <div class="formItem textItem">
                @Html.TextBoxFor(model => model.CompanyAddress, new { @class = "texts" })
            </div>
            <div class="formItem msgItem">
            </div>
        </div>

        <div class="formsItems clearfix">
            <div class="formItem labelItem">
                描述
            </div>
            <div class="formItem textItem">
                @Html.TextAreaFor(model => model.CompanyDesc, new { @class = "texts" })
            </div>
            <div class="formItem msgItem">
            </div>
        </div>

        <div id="btnContainer" class="formsItems">
            <div class="formItem labelItem">
                &nbsp;
            </div>
            <div class="formItem textItem">
                <a href="javascript:void(0);" id="btnSave">保存</a>
                <a href="Index" id="btnCancel">取消</a>
            </div>
            <div class="formItem">
            </div>
        </div>
        <div class="formsItems"></div>
    </div>
}
